package com.andy.blog.admin.dto;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.andy.blog.common.converter.BusinessTypeConverter;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by andy on 2023-04-30 15:45
 */
@Data
@ColumnWidth(20)
@ContentRowHeight(25)
@HeadRowHeight(26)
public class SysOperLogDTO implements Serializable {

    private static final long serialVersionUID = -6930202673260308445L;

    /**
     * 日志主键
     */
    @ExcelProperty(value = "日志编号", index = 0)
    private Long id;

    /**
     * 模块标题
     */
    @ExcelProperty(value = "系统模块", index = 1)
    private String moduleTitle;

    /**
     * 业务类型（0其它 1新增 2修改 3删除）
     */
    @ExcelProperty(value = "操作类型", index = 2, converter = BusinessTypeConverter.class)
    private Integer businessType;

    /**
     * 方法名称
     */
    @ExcelIgnore
    private String operMethod;

    /**
     * 请求方式
     */
    @ExcelIgnore
    private String requestMethod;

    /**
     * 操作类别（0其它 1后台用户 2手机端用户）
     */
    @ExcelIgnore
    private Integer operatorType;

    /**
     * 操作人员
     */
    @ExcelProperty(value = "操作人员", index = 3)
    private String operName;

    /**
     * 部门名称
     */
    @ExcelIgnore
    private String deptName;

    /**
     * 请求URL
     */
    @ExcelIgnore
    private String operUrl;

    /**
     * 主机地址
     */
    @ExcelProperty(value = "操作地址", index = 4)
    private String operIp;

    /**
     * 操作地点
     */
    @ExcelProperty(value = "操作地点", index = 5)
    private String operLocation;

    /**
     * 请求参数
     */
    @ExcelIgnore
    private String operParam;

    /**
     * 返回参数
     */
    @ExcelIgnore
    private String jsonResult;

    /**
     * 操作状态（0正常 1异常）
     */
    @ExcelIgnore
    private Integer status;

    /**
     * 错误消息
     */
    @ExcelIgnore
    private String errorMsg;

    /**
     * 操作时间
     */
    @ExcelProperty(value = "操作时间", index = 6)
    private Date operTime;

    /**
     * 消耗时间
     */
    @ExcelProperty(value = "消耗时间（毫秒）", index = 7)
    private Long costTime;
}
